
package com.joysuch.wwyt.audit.service.impl;

import java.util.List;

import com.joysuch.wwyt.audit.entity.AuditLogRecord;
import com.joysuch.wwyt.audit.repository.AuditLogRecordDao;
import com.joysuch.wwyt.audit.service.AuditLogProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DefaultAuditLogProcessor implements AuditLogProcessor {

    @Autowired
    private AuditLogRecordDao auditLogRecordDao;

    @Override
    public void process(AuditLogRecord record) {
        auditLogRecordDao.save(record);
    }

    @Override
    public void batchProcess(List<AuditLogRecord> list) {
        auditLogRecordDao.saveAll(list);
    }

}
